#ifndef AUDIO_MANAGER_H
#define AUDIO_MANAGER_H

#include <QObject>
#include <QSoundEffect>

class AudioManager : public QObject
{
    Q_OBJECT
public:
    explicit AudioManager(QObject *parent = nullptr);
    ~AudioManager();

    void setBgmPath(const QString &path);
    void initBGM(const QString &path); // 初始化BGM
    void toggleBgm(); // 切换播放/暂停
    void setVolume(int volume); // 0-100
    bool isPlaying() const;

signals:
    void volumeChanged(int volume);

private:
    QSoundEffect *m_bgmPlayer;
    bool m_isPlaying;
    QString m_bgmPath;
};
#endif // AUDIO_MANAGER_H
